<template>
  <div class="processingProgress">
    <div class="header">
      <van-nav-bar title="办理进度" fixed left-text="返回"  left-arrow @click-left="onClickLeft"/>
    </div>
    <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
      <div class="head">
        <p>{{companyName}}</p>
      </div>
      <div class="timeLine">
        <ul class="cbp_tmtimeline">
          <li v-for="(item,index) in stateList" :key="index">
            <span class="circle"></span>
            <time class="cbp_tmtime" datetime="2013-04-10 18:30">
              <p v-if="item.payment_state!==1">{{item.up_datetime}}</p>

              <p v-if="item.flow_state==0">未开始</p>
              <p v-if="item.flow_state==2 && item.payment_state==0">完成</p>
              <p v-if="item.payment_state==1" class="pp">已结算</p>


            </time>
            <div class="cbp_tmlabe cbp_img">
              <h5>{{item.flow_name}}</h5>
            </div>
          </li>
        </ul>
      </div>
    </van-pull-refresh>
  </div>
</template>

<script>
  export default {
    name: "FTApplicationProgress",
    data() {
      return {
        //下拉刷新
        isLoading: false,
        stateList: [],
        companyName: this.$route.query.companyName,

      }
    },
    mounted() {
      this.adoptState();

    },
    methods: {
      //返回
      onClickLeft() {
         this.$router.back();
      },
      //获取养殖状态数据数据
      async adoptState() {
        let params = {
          table_id: this.$route.query.id
        };
        const res = await this.$axios.post(this.$api.FTApplicationProgressData, params);
        if (res.success) {
          this.stateList = res.data;
          this.isLoading = false;
        } else {
          this.$toast(res.msg);
        }
      },
      //下拉刷新
      onRefresh() {
        this.adoptState();
      }
    }
  }
</script>

<style scoped>
  @import "../../assets/css/farmingState.css";
  .processingProgress{width: 100%;background-color: #f7f7f7;}
  .header {
    width: 100%;
  }
  .head{
    width: 94%;
    line-height: 0.66rem;
    background: #fff;
    border-radius: 0.1rem;
    margin: 0.1rem auto;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;

  }
  .head p{text-align: center;}
  .van-pull-refresh{padding-top: 0.46rem;}
  .timeLine {
    width: 94%;
    margin: 0.5rem auto;
  }
  .cbp_tmtimeline {
    margin: 30px 0 0 0;
    padding: 0;
    list-style: none;
    position: relative;
  }
  .cbp_tmtimeline > li:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ccc;
    left: 32%;
    margin-left: -10px;
  }
  .cbp_tmtimeline > li:last-child:before {
    width: 0;
  }
  .cbp_tmtimeline > li {
    position: relative;
    margin: 0;
    padding: 0;
    display: inline-block;
    width: 100%;
  }
  .cbp_tmtimeline > li .cbp_tmtime {
    font-size: 1.1em;
    top:-0.1rem;
  }
  .cbp_tmtime p{display: inline-block;font-size: 0.14rem;}
  .cbp_tmtime span{display: inline-block;font-size: 0.14rem;}
  .cbp_tmtimeline > li .circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    display: block;
    position: absolute;
    left: 32%;
    margin-left: -14px;
    z-index: 2;
    top: -4px;
  }
  .cbp_tmtimeline > li .circle:hover {
    background: #06d039;
  }
  .cbp_tmtimeline > li:after {
    content: "";
    position: absolute;
    height: 2px;
    background: #ccc;
    left: 32%;
    margin-left: -10px;
    width: 50%;
    top: 0;
    z-index: 1;
  }

  .cbp_tmtimeline > li .cbp_img {
    margin: 0 0 15px 35%;
    background: #fff;
    color: #333;
    font-size: 1.4em;
    font-weight: 300;
    line-height: 1.4;
    position: relative;
    border-radius: 10px;
    box-sizing: border-box;
    top: -23px;
    z-index: 3;
    overflow: hidden;
  }
  .cbp_tmtimeline > li .cbp_img img {
    width: 100%;
    height: auto;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }
  .cbp_tmtimeline > li .cbp_img h5 {
    padding: 12px 15px;
    font-size: 0.14rem;
  }
  .cbp_tmtimeline li:nth-child(1) span {background-color: #01bf47;}
  .cbp_tmtimeline li:nth-child(1):after{background-color: #01bf47;}
  .cbp_tmtimeline li:nth-child(1) .cbp_img{background-color: #01bf47;}
  .cbp_tmtimeline li:nth-child(1) .cbp_img h5{color: #fff;}
  .pp{color: #01bf47;}

</style>
